package qiurank;

import java.lang.reflect.Constructor;

/**
 * Created by Administrator on 2016/1/18.
 */
public class HandleFactory {
    public static Class<?> handle=null;
    public static Constructor<?> _class=null;
    public static Object createHandle(){
        try {
            if (HandleFactory.handle == null) {
                HandleFactory.handle = Class.forName("app."+Config.getValue("package")+"."+Config.getValue("package")+"Handle");
                HandleFactory._class=HandleFactory.handle.getConstructors()[0];
                return HandleFactory._class.newInstance();
            } else {
                return HandleFactory._class.newInstance();
            }
        }catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
}
